﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Api.Models;
@using WebVella.Erp.Web;
@using WebVella.Erp.Plugins.Project.Components;

@{
	var erpRequestContext = (ErpRequestContext)ViewBag.RequestContext;
	var options = (PcPostList.PcPostListOptions)ViewBag.Options;
	var currentUser = (ErpUser)ViewBag.CurrentUser;
	var records = (List<EntityRecord>)ViewBag.Records;
	var currentUserName = "guest";
	var currentUserImagePath = "/_content/WebVella.Erp.Web/assets/avatar.png";
	if (currentUser != null)
	{
		currentUserName = currentUser.Username;
		if (!String.IsNullOrWhiteSpace(currentUser.Image))
		{
			currentUserImagePath = currentUser.Image;
		}
	}
}

<script type="module" src="/_content/WebVella.Erp.Plugins.Project/js/wv-post-list/wv-post-list.esm.js"></script>
<script nomodule src="/_content/WebVella.Erp.Plugins.Project/js/wv-post-list/wv-post-list.js"></script>

  <wv-post-list related-record-id="@ViewBag.RelatedRecordId" related-records='@ViewBag.RelatedRecordsJson'
	site-root-url="@ViewBag.SiteRootUrl"
	posts='@ViewBag.RecordsJson'
	current-user='@ViewBag.CurrentUserJson'></wv-post-list>
